<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitUpdate34 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('package_skus', function (Blueprint $table) {

            $table->json('assets')->nullable()->comment('当sku_type为2时，绑定的虚拟资产'); 
            $table->integer('product_id')->index()->nullable()->comment('当sku_type为1时, 绑定的商品id');
            $table->string('sid', 20)->index()->nullable()->comment('短id');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('package_skus', function (Blueprint $table) {

            Schema::dropIfExists('assets');
            Schema::dropIfExists('product_id');
            Schema::dropIfExists('sid');
            
        });
    }
}
